﻿using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Diagnostics;
using NyBio.Model;
using NyBio.DB;

namespace NyBio.Ctrl
{

    class MovieCtrl
    {
        private MovieDB movieDB;

        public MovieCtrl()
        {
            movieDB = new MovieDB();
        }

        public Movie getMovieById(int id)
        {
            return movieDB.getMovieById(id);
        }

        public List<Movie> getMovieSearch(string title)
        {
            return movieDB.getMovieSearch(title);
        }

        public List<Movie> getMovies()
        {
            return movieDB.getMovies();
        }

        public void insertMovie(Movie movie)
        {
            movieDB.insertMovie(movie);
        }

        public void deleteMovie(int id)
        {
            movieDB.deleteMovie(id);
        }

        public void updateMovie(Movie movie)
        {
            movieDB.updateMovie(movie);
        }
    }
}